package com.atguigu.gmall.realtime.web.mapper;

import com.atguigu.gmall.realtime.web.bean.NameValueBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface TradeProvinceOrderWindowMapper {

    @Select("select sum(order_amount) from dws_trade_province_order_window where  toYYYYMMDD(stt)=#{dt}")
    public BigDecimal getTotalAmount(Long dt);


    @Select("select  province_name name, cast( sum(order_amount) as Decimal(16,2)) value  from    dws_trade_province_order_window where  toYYYYMMDD(stt)=#{dt}  group by  province_name")
    public List<NameValueBean> getOrderAmountGroupByProvince(Long dt);
}
